#include "stm32f10x.h"                  // Device header
#include "OLED.h"
#include "key.h"
#include "servo.h"
#include "delay.h"

uint16_t KeyNum,Angle;
int main(void)
{
	OLED_Init();
	Servo_Init();
	OLED_ShowString(1,1,"Angle:");
	while(1)
	{
		KeyNum=Key_GetNum();
		if(KeyNum==1)
		{
			Angle+=30;
			if(Angle>180)
				Angle=0;
		}
		Servo_SetAngle(Angle);
		OLED_ShowNum(1,7,Angle,5);
	}
}
